<?php echo getModuleDemo($item['border'], $item['header'], $item['border2'], $item['footer'], $item['button'], $button_params, $buttons_params); ?>

<input type="hidden" name="action" value="editor" />
<input type="hidden" name="item" value="<?php echo $item['id']; ?>" />
<fieldset>
	<dl>
		<dt>Name:</dt>
		<dd>
			<input name="name" type="text" value="<?php echo $item['name']; ?>" style="width:30%">
			&nbsp;<?php echo $error['name']; ?>
			<input type="submit" value="Save" style="padding-left:20px; padding-right:10px;  background-image: url('../images/system/save.gif'); border:1px solid #DDDDDD; height:20px;" class="buttons">
		</dd>
	</dl>
    <dl>
		<dt>Outer Border:</dt>
		<dd>
            <select name="border" onchange="submit();" style="width:50%;">
				<option value="0" selected>None</option>
                <?php 
					if($borders)
					{
						foreach($borders as $border)
						{
							if ($border['id'] == $item['border'])
							{ echo '<option value="'.$border['id'].'" selected="selected">'.$border['name'].'</option>'; }
							else
							{ echo '<option value="'.$border['id'].'">'.$border['name'].'</option>'; }
						}
					}
				?>
			</select>
		</dd>
	</dl>
    <dl>
		<dt>Header:</dt>
		<dd>
            <select name="header" onchange="submit();" style="width:50%;">
				<option value="0" selected>None</option>
                <?php 
					if($headers)
					{
						foreach($headers as $header)
						{
							if ($header['id'] == $item['header'])
							{ echo '<option value="'.$header['id'].'" selected="selected">'.$header['name'].'</option>'; }
							else
							{ echo '<option value="'.$header['id'].'">'.$header['name'].'</option>'; }
						}
					}
				?>
			</select>
		</dd>
	</dl>
    <dl>
		<dt>Inner Border:</dt>
		<dd>
            <select name="border2" onchange="submit();" style="width:50%;">
				<option value="0" selected>None</option>
                <?php 
					if($borders)
					{
						foreach($borders as $border)
						{
							if ($border['id'] == $item['border2'])
							{ echo '<option value="'.$border['id'].'" selected="selected">'.$border['name'].'</option>'; }
							else
							{ echo '<option value="'.$border['id'].'">'.$border['name'].'</option>'; }
						}
					}
				?>
			</select>
		</dd>
	</dl>
    <dl>
        <dt>Composition Footer:</dt>
        <dd>
            <select name="footer" onchange="submit();" style="width:50%;">
                <option value="0" selected>None</option>
                <?php 
                    if($footers)
                    {
                        foreach($footers as $footer)
                        {
                            if ($footer['id'] == $item['footer'])
                            { echo '<option value="'.$footer['id'].'" selected="selected">'.$footer['name'].'</option>'; }
                            else
                            { echo '<option value="'.$footer['id'].'">'.$footer['name'].'</option>'; }
                        }
                    }
                ?>
            </select>
        </dd>
    </dl>
    <dl>
		<dt>Content Area Button:</dt>
		<dd>
            <select name="button" onchange="submit();" style="width:50%;">
				<option value="0" selected>None</option>
                <?php 
					if($buttons)
					{
						foreach($buttons as $button)
						{
							if ($button['id'] == $item['button'])
							{ echo '<option value="'.$button['id'].'" selected="selected">'.$button['name'].'</option>'; }
							else
							{ echo '<option value="'.$button['id'].'">'.$button['name'].'</option>'; }
						}
					}
				?>
			</select>
		</dd>
	</dl>
	<dl>
		<dt>HFB Set Categories:</dt>
		<dd>
			<select size="10" name="hfb_cats" style="width:25%;">
				<?php 
				if($hfbcats)
				{
					foreach($hfbcats as $hfbcat)
					{
						echo '<option ondblclick="edit_form.add_to_cat.value=this.value; edit_form.submit();" value="'.$hfbcat['id'].'">'.$hfbcat['title'].'</option>';
					}
				}
				?>
			</select>
			<select size="10" name="hfb_in_cats" style="width:25%;">
				<?php 
				if($incats)
				{
					foreach($incats as $incat)
					{
						echo '<option ondblclick="edit_form.rem_from_cat.value=this.value; edit_form.submit();" value="'.$incat['id'].'">'.$incat['title'].'</option>';
					}
				}
				?>
			</select>
			<input type="hidden" id="add_to_cat" name="add_to_cat" value="0" />
			<input type="hidden" id="rem_from_cat" name="rem_from_cat" value="0" />
		</dd>
	</dl>
</fieldset>